/*
 * XML Type:  ClosureOption
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.ClosureOption
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML ClosureOption(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class ClosureOptionImpl extends net.ofx.types.x2003.x04.impl.AbstractInvestmentTransactionImpl implements net.ofx.types.x2003.x04.ClosureOption
{
    
    public ClosureOptionImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SECID$0 = 
        new javax.xml.namespace.QName("", "SECID");
    private static final javax.xml.namespace.QName OPTACTION$2 = 
        new javax.xml.namespace.QName("", "OPTACTION");
    private static final javax.xml.namespace.QName UNITS$4 = 
        new javax.xml.namespace.QName("", "UNITS");
    private static final javax.xml.namespace.QName SHPERCTRCT$6 = 
        new javax.xml.namespace.QName("", "SHPERCTRCT");
    private static final javax.xml.namespace.QName SUBACCTSEC$8 = 
        new javax.xml.namespace.QName("", "SUBACCTSEC");
    private static final javax.xml.namespace.QName RELFITID$10 = 
        new javax.xml.namespace.QName("", "RELFITID");
    private static final javax.xml.namespace.QName GAIN$12 = 
        new javax.xml.namespace.QName("", "GAIN");
    
    
    /**
     * Gets the "SECID" element
     */
    public net.ofx.types.x2003.x04.SecurityId getSECID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SecurityId target = null;
            target = (net.ofx.types.x2003.x04.SecurityId)get_store().find_element_user(SECID$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "SECID" element
     */
    public void setSECID(net.ofx.types.x2003.x04.SecurityId secid)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SecurityId target = null;
            target = (net.ofx.types.x2003.x04.SecurityId)get_store().find_element_user(SECID$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.SecurityId)get_store().add_element_user(SECID$0);
            }
            target.set(secid);
        }
    }
    
    /**
     * Appends and returns a new empty "SECID" element
     */
    public net.ofx.types.x2003.x04.SecurityId addNewSECID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SecurityId target = null;
            target = (net.ofx.types.x2003.x04.SecurityId)get_store().add_element_user(SECID$0);
            return target;
        }
    }
    
    /**
     * Gets the "OPTACTION" element
     */
    public net.ofx.types.x2003.x04.OptionActionEnum.Enum getOPTACTION()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(OPTACTION$2, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.OptionActionEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "OPTACTION" element
     */
    public net.ofx.types.x2003.x04.OptionActionEnum xgetOPTACTION()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.OptionActionEnum target = null;
            target = (net.ofx.types.x2003.x04.OptionActionEnum)get_store().find_element_user(OPTACTION$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "OPTACTION" element
     */
    public void setOPTACTION(net.ofx.types.x2003.x04.OptionActionEnum.Enum optaction)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(OPTACTION$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(OPTACTION$2);
            }
            target.setEnumValue(optaction);
        }
    }
    
    /**
     * Sets (as xml) the "OPTACTION" element
     */
    public void xsetOPTACTION(net.ofx.types.x2003.x04.OptionActionEnum optaction)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.OptionActionEnum target = null;
            target = (net.ofx.types.x2003.x04.OptionActionEnum)get_store().find_element_user(OPTACTION$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.OptionActionEnum)get_store().add_element_user(OPTACTION$2);
            }
            target.set(optaction);
        }
    }
    
    /**
     * Gets the "UNITS" element
     */
    public java.lang.String getUNITS()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(UNITS$4, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "UNITS" element
     */
    public net.ofx.types.x2003.x04.QuantityType xgetUNITS()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.QuantityType target = null;
            target = (net.ofx.types.x2003.x04.QuantityType)get_store().find_element_user(UNITS$4, 0);
            return target;
        }
    }
    
    /**
     * Sets the "UNITS" element
     */
    public void setUNITS(java.lang.String units)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(UNITS$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(UNITS$4);
            }
            target.setStringValue(units);
        }
    }
    
    /**
     * Sets (as xml) the "UNITS" element
     */
    public void xsetUNITS(net.ofx.types.x2003.x04.QuantityType units)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.QuantityType target = null;
            target = (net.ofx.types.x2003.x04.QuantityType)get_store().find_element_user(UNITS$4, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.QuantityType)get_store().add_element_user(UNITS$4);
            }
            target.set(units);
        }
    }
    
    /**
     * Gets the "SHPERCTRCT" element
     */
    public java.lang.String getSHPERCTRCT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SHPERCTRCT$6, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "SHPERCTRCT" element
     */
    public net.ofx.types.x2003.x04.SharesPerType xgetSHPERCTRCT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SharesPerType target = null;
            target = (net.ofx.types.x2003.x04.SharesPerType)get_store().find_element_user(SHPERCTRCT$6, 0);
            return target;
        }
    }
    
    /**
     * Sets the "SHPERCTRCT" element
     */
    public void setSHPERCTRCT(java.lang.String shperctrct)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SHPERCTRCT$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SHPERCTRCT$6);
            }
            target.setStringValue(shperctrct);
        }
    }
    
    /**
     * Sets (as xml) the "SHPERCTRCT" element
     */
    public void xsetSHPERCTRCT(net.ofx.types.x2003.x04.SharesPerType shperctrct)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SharesPerType target = null;
            target = (net.ofx.types.x2003.x04.SharesPerType)get_store().find_element_user(SHPERCTRCT$6, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.SharesPerType)get_store().add_element_user(SHPERCTRCT$6);
            }
            target.set(shperctrct);
        }
    }
    
    /**
     * Gets the "SUBACCTSEC" element
     */
    public net.ofx.types.x2003.x04.SubAccountEnum.Enum getSUBACCTSEC()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SUBACCTSEC$8, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.SubAccountEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "SUBACCTSEC" element
     */
    public net.ofx.types.x2003.x04.SubAccountEnum xgetSUBACCTSEC()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SubAccountEnum target = null;
            target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().find_element_user(SUBACCTSEC$8, 0);
            return target;
        }
    }
    
    /**
     * Sets the "SUBACCTSEC" element
     */
    public void setSUBACCTSEC(net.ofx.types.x2003.x04.SubAccountEnum.Enum subacctsec)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SUBACCTSEC$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SUBACCTSEC$8);
            }
            target.setEnumValue(subacctsec);
        }
    }
    
    /**
     * Sets (as xml) the "SUBACCTSEC" element
     */
    public void xsetSUBACCTSEC(net.ofx.types.x2003.x04.SubAccountEnum subacctsec)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SubAccountEnum target = null;
            target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().find_element_user(SUBACCTSEC$8, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().add_element_user(SUBACCTSEC$8);
            }
            target.set(subacctsec);
        }
    }
    
    /**
     * Gets the "RELFITID" element
     */
    public java.lang.String getRELFITID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(RELFITID$10, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "RELFITID" element
     */
    public net.ofx.types.x2003.x04.FinancialInstitutionTransactionIdType xgetRELFITID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.FinancialInstitutionTransactionIdType target = null;
            target = (net.ofx.types.x2003.x04.FinancialInstitutionTransactionIdType)get_store().find_element_user(RELFITID$10, 0);
            return target;
        }
    }
    
    /**
     * True if has "RELFITID" element
     */
    public boolean isSetRELFITID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(RELFITID$10) != 0;
        }
    }
    
    /**
     * Sets the "RELFITID" element
     */
    public void setRELFITID(java.lang.String relfitid)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(RELFITID$10, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(RELFITID$10);
            }
            target.setStringValue(relfitid);
        }
    }
    
    /**
     * Sets (as xml) the "RELFITID" element
     */
    public void xsetRELFITID(net.ofx.types.x2003.x04.FinancialInstitutionTransactionIdType relfitid)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.FinancialInstitutionTransactionIdType target = null;
            target = (net.ofx.types.x2003.x04.FinancialInstitutionTransactionIdType)get_store().find_element_user(RELFITID$10, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.FinancialInstitutionTransactionIdType)get_store().add_element_user(RELFITID$10);
            }
            target.set(relfitid);
        }
    }
    
    /**
     * Unsets the "RELFITID" element
     */
    public void unsetRELFITID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(RELFITID$10, 0);
        }
    }
    
    /**
     * Gets the "GAIN" element
     */
    public java.lang.String getGAIN()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(GAIN$12, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "GAIN" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetGAIN()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(GAIN$12, 0);
            return target;
        }
    }
    
    /**
     * True if has "GAIN" element
     */
    public boolean isSetGAIN()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(GAIN$12) != 0;
        }
    }
    
    /**
     * Sets the "GAIN" element
     */
    public void setGAIN(java.lang.String gain)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(GAIN$12, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(GAIN$12);
            }
            target.setStringValue(gain);
        }
    }
    
    /**
     * Sets (as xml) the "GAIN" element
     */
    public void xsetGAIN(net.ofx.types.x2003.x04.AmountType gain)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(GAIN$12, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(GAIN$12);
            }
            target.set(gain);
        }
    }
    
    /**
     * Unsets the "GAIN" element
     */
    public void unsetGAIN()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(GAIN$12, 0);
        }
    }
}
